/**
 * @program: LeetCode
 * @description: LeetCode : 2526. 找到数据流中的连续整数
 * @author: WXY
 * @create: 2023-02-03 21:06
 * @Version 1.0
 **/
public class Num2526_DataStream {
    class DataStream {
        int count = 0;
        int val = 0;
        int len = 0;
        public DataStream(int value, int k) {
            len = k;
            val = value;
        }

        public boolean consec(int num) {
            if (val == num) {
                count++;
            } else {
                count = 0;
            }
            return count >= len;
        }
    }
}
